package com.hele.sts.action.admin;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.hele.sts.dao.DjjgDao;
import com.hele.sts.webwork.PageAction;
import com.opensymphony.xwork2.ActionContext;

public class DjjgAction
  extends PageAction
{
  static Logger logger = LoggerFactory.getLogger(DjjgAction.class);
  List djjgList;
  String action;
  String djjg;
  String errorInfo;
  String code;
  String content;
  
  public String getCode()
  {
    return this.code;
  }
  
  public void setCode(String code)
  {
    this.code = code;
  }
  
  public String getContent()
  {
    return this.content;
  }
  
  public void setContent(String content)
  {
    this.content = content;
  }
  
  public String execute()
    throws Exception
  {
    ActionContext ctx = ActionContext.getContext();
    Map session = ctx.getSession();
    String loginName = (String)session.get("AdminUser.loginName");
    if ((loginName == null) || (loginName.length() < 1))
    {
      setErrorInfo("没有登录");
      return "error";
    }
    logger.debug(this.action);
    if ((this.action == null) || (this.action.length() < 1)) {
      return list();
    }
    return null;
  }
  
  public int count()
  {
    return DjjgDao.count1(this.djjg);
  }
  
  public String list()
  {
    this.djjgList = DjjgDao.djjginfo();
    return "list";
  }
  
  public String getErrorInfo()
  {
    return this.errorInfo;
  }
  
  public void setErrorInfo(String errorInfo)
  {
    this.errorInfo = errorInfo;
  }
  
  public String getHref()
  {
    return null;
  }
  
  public static Logger getLogger()
  {
    return logger;
  }
  
  public static void setLogger(Logger logger)
  {
    logger = logger;
  }
  
  public String getDjjg()
  {
    return this.djjg;
  }
  
  public void setDjjg(String djjg)
  {
    this.djjg = djjg;
  }
  
  public List getDjjgList()
  {
    return this.djjgList;
  }
  
  public void setDjjgList(List djjgList)
  {
    this.djjgList = djjgList;
  }
}
